<?php
namespace app\admin\controller\v1;

use app\common\model\User as UserModel;

use think\Controller;

class User extends Controller
{
    public function getByOpenId($openid){
        $product = UserModel::getByOpenId($openid);
        return successReturn($product);
    }
    public function getById($id){
        $product = UserModel::getById($id);
        return successReturn($product);
    }
    public function getAll(){
        $where = input('get.');
        $products = UserModel::getAll($where);
        return successReturn($products);
    }
    public function createOne(){
        UserModel::createOne();
        return successReturn();
    }
    public function updateOne($id){
        $data = input('put.');
        UserModel::updateOne($id,$data);
        return successReturn();
    }
    public function deleteOne($id){
        UserModel::deleteOne($id);
        return successReturn();
    }
}
